package com.jiagoushi.cloud.study.controller;

import com.jiagoushi.cloud.study.entity.User;
import com.jiagoushi.cloud.study.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.jiagoushi.cloud.study.service.UserService;

/**
 * 不推荐
 */
@RestController
public class RefactorUserController implements UserService {
	
	@Autowired
	private UserRepository userRepository;
	
	@Override
    public User getUser(@PathVariable Long id) {
		User user = userRepository.findOne(id);
	    return user;
    }

}